import React,{useContext} from 'react'
import { MyContext } from '../../App'
import Header from '../../components/Header/Header'
import {actions} from '../../reducer/app'
export default function Mine() {
  const {state,dispatch}=useContext(MyContext)
  return (
    <div>
      <Header title='个人中心'></Header>
      <div>state:{JSON.stringify(state.userInfo)}</div>
      <div>昵称：{state.userInfo.nickname}</div>
      <button onClick={()=>{
        dispatch(actions.changeUserInfo({}))
      }}>退出登录</button>
    </div>
  )
}
